package com.anabur.persistent.system;

import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;

import com.anabur.system.AafAbstractPersistent;


@NamedQueries( { 
	@NamedQuery(
			name = "User.data_for_abm",
			query="SELECT u.name as NAME, " +
					"u.password as PASS " +
					"FROM User u")})

@Entity
@Table(name = "USER_", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class User extends AafAbstractPersistent{
	
	private String name;
	private String password;
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Transient
	public String informationToDelete() {
		return name;
	}

}
